<template>
  <div class="page-department">
    <div class="component-mainHeader">
      <div class="top">
        <div class="topleft">
          <p>
            <span class="iconfont" style="color:#1abc9a;margin-right:3px;">&#xe607;</span>查看详情
          </p>
        </div>
        <div class="topright">
          <el-button type="info"  @click="$router.go(-1)">
            <span style="font-weight:700;margin-right:5px;" class="iconfont">&#xe606;</span>返回
          </el-button>
        </div>
      </div>
    </div>

    <!-- 表格 -->
    <div class="table">
      <el-table ref="multipleTable" :data="info" tooltip-effect="dark" style border>
        <el-table-column label="队员名称" align="center" prop="userTruename"></el-table-column>
        <el-table-column label="性别" align="center" prop="userOrg">
          <template slot-scope="scope">
            <span v-if="scope.row.userGender == 0">女</span><span v-else>男</span>
          </template>
        </el-table-column>
        <el-table-column label="手机号" align="center" prop="userPhone"></el-table-column>
        <el-table-column label="身份证号" align="center" prop="idcardNo"></el-table-column>
        <el-table-column label="保单号" align="center" prop="idcardNo"></el-table-column>
        <el-table-column label="操作" align="center">
          <template slot-scope="scope">
            <a @click="preview(scope.row.userId,['IdCard_0','IdCard_1'])">查看身份证</a>
            <a @click="preview(scope.row.userId,['WorkInsurance'])">查看保险信息</a>
          </template>
        </el-table-column>
      </el-table>
    </div>
    <!--图片预览-->
    <div class="component-model">
      <el-dialog title="预览" :visible.sync="imgFlag" width="1100px">
        <div v-if="fileUrlList.length>0" style="margin-bottom: 10px;">
          <img v-for="(item,index) in fileUrlList" :key="index" :src="exe_img + item.fileUrl" style="max-width: 1000px;">
        </div>
        <div v-else>
          暂无图片~
        </div>
      </el-dialog>
    </div>

    <!-- 分页 -->
    <!--<div class="component-paging" v-if="info.length > 0">-->
      <!--<div class="table-bottom">-->
        <!--<div class="bottom-left"></div>-->
        <!--<div class="paging">-->
          <!--<div class="paging-left">-->
            <!--<p>-->
              <!--共-->
              <!--<span>{{Math.ceil(total/pageSize)}}</span> 页/-->
              <!--<span>{{total}}</span> 条数据-->
            <!--</p>-->
          <!--</div>-->
          <!--<el-pagination-->
            <!--background-->
            <!--@size-change="SizeChange($event,dataInit,currentPage,pageSize)"-->
            <!--@current-change="CurrentChange($event,dataInit,currentPage,pageSize)"-->
            <!--:current-page="currentPage"-->
            <!--:page-sizes="[10, 20, 30]"-->
            <!--:page-size="pageSize"-->
            <!--layout="sizes, prev, pager, next, jumper"-->
            <!--:total="total"-->
          <!--&gt;</el-pagination>-->
        <!--</div>-->
      <!--</div>-->
    <!--</div>-->
  </div>
</template>

<script>
export default {
  name: "seeDetails",
  data() {
    return {
      info: [],
      limit: true,
      total: 0,// 数据总条数
      pageSize: 10,// 每页显示数据的条数
      currentPage: 1,// 当前显示的页面页码
      imgFlag:false,//图片预览弹框
      fileUrlList:[],//文件路径
      exe_img:img_url,//图片前缀
    };
  },
  mounted() {
      this.dataInit();
  },
  methods: {
    dataInit(){
      let that = this;
      let suCb = function(res){
        that.info = res.data.data
        console.log(res)
      }
      let erCb = function(res){
        console.log(res)
      }
      let postData = {
          orgId:that.$route.params.id
      }
      let palyParam = {
        url: "/api/web/proTeam/getProTeamStaff",
        methods:'post',
        data: postData,
        success: suCb,
        error: erCb,
      }
      that.$https(palyParam)
    },
    //图片预览
    preview(val,types){
      let that = this;
      let suCb = function(res){
        that.fileUrlList = res.data.data;
        that.imgFlag = !this.imgFlag;
        console.log(this.fileUrlList)
      }
      let erCb = function(res){
        console.log(res)
      }
      let postData = {
        userId:val,
        bizType:types,
      }
      let palyParam = {
        url: "/api/web/proTeam/getTeamPic",
        methods:'post',
        data: postData,
        success: suCb,
        error: erCb,
      }
      that.$https(palyParam)
    }
  }
};
</script>

<style scoped>
.component-searchHeader .search-header {
  width: 1100px;
  box-sizing: border-box;
  border: 1px solid rgba(228, 228, 228, 1);
  background-color: rgba(255, 255, 255, 1);
  margin: 20px auto 0;
}

.component-searchHeader .search-header .left-title {
  display: flex;
  justify-content: space-between;
  width: 100%;
  background-color: rgba(243, 243, 243, 1);
  height: 45px;
  box-sizing: border-box;
}

.component-searchHeader .search-header .left-title .left-text {
  width: 20%;
  color: #666;
  line-height: 45px;
  font-family: "微软雅黑";
  font-weight: 400;
  font-size: 12px;
  text-align: left;
  margin: 0 0 0 30px;
}

.component-searchHeader .right {
  width: 70%;
  display: flex;
  justify-content: flex-end;
  margin-right: 30px;
}

.component-listHeader .search-header .left-title {
  display: flex;
  justify-content: space-between;
  width: 100%;
  background-color: rgba(243, 243, 243, 1);
  height: 45px;
  box-sizing: border-box;
}

.component-listHeader .search-header .left-title .left-text {
  width: 20%;
  color: #666;
  line-height: 45px;
  font-family: "微软雅黑";
  font-weight: 400;
  font-size: 12px;
  text-align: left;
  margin: 0 0 0 30px;
}

.table {
  width: 1100px;
  margin: 0 auto;
  margin-top: 30px;
}

.el-table .cell a {
  color: #1abc9a;
  text-decoration: none;
  cursor: pointer;
}
</style>
